<template>
	<view class="input">
		<input type="text" v-model.trim="pwd" :placeholder="placeholder" :maxlength="maxLen"
		class="input__pwd" :password="isHidePwd"/>
		<view class="input__icon" v-if="pwd" @click="isHidePwd=!isHidePwd">
			<uni-icons type="eye" color="#fff" size="26" v-if="isHidePwd"></uni-icons>
			<uni-icons type="eye-filled" :color="activeColor" size="26" v-else></uni-icons>
		</view>
	</view>
</template>
<script>
	export default{
		data(){
			return {
				pwd:"", //密码
				isHidePwd:true, //是否开启隐藏密码
			}
		},
		props:{
			activeColor:{ //1975FF
				type:String,
				default:"#fff"
			},
			placeholder:{
				type:String,
				default:"请输入"
			},
			maxLen:{
				type:Number,
				default:16
			}
		},
	}
</script>

<style lang="scss" scoped>
	.input{
		@include flexRowAlign();
		height: 76rpx;
		border-radius: 12rpx;
		width: 100%;
		.input__pwd{
			color: #fff;
			font-size: 30rpx;
			flex: 1;
		}
		.input__icon{
			margin-left: 20rpx;
			@include flexRowAlign();
		}
	}
</style>